﻿<UserControl x:Class="CncConvProg.View.Lavorazioni.Fresatura.Pattern.MillingPatternSelectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ValueConverter="clr-namespace:CncConvProg.View.ValueConverter" 
             xmlns:Pattern="clr-namespace:CncConvProg.Model.ConversationalStructure.Lavorazioni.Fresatura.Pattern;assembly=CncConvProg.Model" xmlns:Resources="clr-namespace:MecPrev.Resources;assembly=MecPrev.Resources" mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="600">
    <UserControl.Resources>
        <ValueConverter:EnumToBoolConverter x:Key="EBConverter"/>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height=".7*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width=".5*" />
            <ColumnDefinition Width=".5*" />
        </Grid.ColumnDefinitions>
        <GroupBox Header="{x:Static Resources:EditWorkRes.PatternSelection}">
            <ListBox x:Name="RadioButtonList" BorderThickness="0" Background="{x:Null}">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="{x:Type ListBoxItem}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                    <ContentPresenter/>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </ListBox.ItemContainerStyle>
                <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton12, Mode=OneWay}">
                    <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.Rettangolo}}" 
                        Content="{x:Static Resources:EditWorkRes.Rectangle}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton12"     
                        />
                </ListBoxItem>
                <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton4, Mode=OneWay}">
                    <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.Cerchio}}" 
                        Content="{x:Static Resources:EditWorkRes.Circle}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton4" 
                        
                    />
                </ListBoxItem>
                <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton1, Mode=OneWay}" Tag="images/pentagono.png">
                    <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.PoligonoRegolare}}" 
                        Content="{x:Static Resources:EditWorkRes.RegularPolygon}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton1"     
                        
                        />
                </ListBoxItem>
                <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton2, Mode=OneWay}">
                    <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.ProfiloLibero}}" 
                        Content="{x:Static Resources:EditWorkRes.ProfileEditor}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton2" 
                        
                    />
                </ListBoxItem>
                <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton3, Mode=OneWay}" Tag="images/arco.png">
                    <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.CavaArco}}" 
                        Content="{x:Static Resources:EditWorkRes.Arc}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton3" 
                        
                    />
                </ListBoxItem>

                <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton5, Mode=OneWay}">
                    <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.CavaDritta}}" 
                        Content="{x:Static Resources:EditWorkRes.Slot}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton5" 
                        
                    />
                </ListBoxItem>
                <ListBoxItem Visibility="{Binding Path=ShowExternMillingPattern}" IsSelected="{Binding IsChecked, ElementName=RadioButton6, Mode=OneWay}">
                    <RadioButton IsChecked="{Binding Path=PatternFresatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Pattern:EnumPatternMilling.CavaDrittaAperta}}" 
                        Content="{x:Static Resources:EditWorkRes.DSlot}"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton6" 
                        
                    />
                </ListBoxItem>
            </ListBox>
        </GroupBox>
        <Image Grid.Column="1" Width="200" Source="{Binding SelectedItem.Tag, ElementName=RadioButtonList}" />
        <GroupBox Header="{x:Static Resources:EditWorkRes.PatternParameter}" Grid.Row="1" Grid.ColumnSpan="2">
            <ContentControl Content="{Binding Path=PatternParameter}"/>
        </GroupBox>

    </Grid>
</UserControl>
